pp108 : Generating Web Service Operations on Java Classes

Generating Web Service Operations on Java Classes

This topic contains the procedure to generate Web service operations on Java classes created outside WS-AppServer environment.

Before you begin this task:
Ensure that the Java Class Metadata model is available.

This option facilitates generating Web service operations on a Java Class Metadata that is mapped to a JAR file or Java classes that were created outside Process Platform environment. This feature helps you to import any application logic in the form of Java files that you think is important or relevant to the application being built. The Web service operations that you create on these files can be published in the same way you create and publish Web service operations on a database.

  1. Select one of the starting points:
    • In Workspace Documents (My Recent Documents) window, place the mouse pointer over (Java Class Metadata), click and select Actions > Generate Web services.
    • Open Workspace Documents (Explorer) > <solution> > <project>, right-click <Java Class Metadata> and select Generate Web services. The Java Class Metadata window appears, displaying the name of the Java Class Metadata on its title bar.
  2. In the Java Class Metadata Explorer, expand the Java Class model and select the (Java Class) on which you want to generate the Web services.

    Note:
    You can only select Static methods. The methods of the selected Java Class appear on the right-side pane.

  3. On the Methodstab, select the methods upon which you want to generate the Web service operations. You can also perform the following optional activities:
    • Change the name of the Web service operation to suit your functional needs.
    • For a selected Web service operation, click and do the following on the Advanceddialog box:
      • If you want to treat a parameter with i4 data type as XML in a request, select the XML Node check box. The check box appears only if the data type is i4. XML Node is not applicable for other data types.
      • Modify the parameter name depending upon your functional needs. The implementation will display this name instead of the default parameter name. Even if you change the name, the values will remain intact.
      • Depending upon whether you want the parameter in the request or in response or in both, set the Scope to in (only in request), out (only in response), or inout (in both request and response).Click OK to save the changes and close the dialog box.
  4. On the Web service Interface Detailstab, do one of the following:
    • Generate Web service operations under a new Web service interface. You may change the names in the Web service, Web service Interface Name and the Namespace fields if you do not want the default ones. Click to browse and choose a Location to create the Web service interface.
    • Select Existing to generate the Web service operations within an existing Web service interface. Click to browse and choose the Web service interface.
  5. Click Finish. The Java Class Metadata window closes.

The Web service operations for the selected Java Class are generated. The Web service bearing the Web service Interface and Web service Operations for the selected Java Class(es) is stored at the same location where the Java Class Metadata is stored.

After you complete this task
After you generate the Web service, do the following:

  1. In the Web service Interface properties, select the Service to which this Web service will be attached.
  2. Publish the generated Web service operations to the organization and attach the Web service interface to the WS-AppServer Service before you can use them at runtime.
  3. The JAR location should be added to the classpath.
  4. Restart the WS-AppServer service.

 

 

Related tasks

Creating a Java Archive Definition
Creating a Java Class Metadata
Generating Custom Web Service Operations on Database Details
Generating Standard Web Service Operations on a Database
Generating Web Service Operations on a Database Metadata
Generating Web Service Operations on a WS-AppServer Package
Generating Web Service Operations on Custom Logic
Testing Web Service Operations
Viewing the WSDL of a Web Service Operation

Related reference

Exploring Web Service and its Child Entities